import axios from 'axios'

export default function ({ route,store }) {
  // console.log(store)
  return axios.get(process.env.BASE_URL + '/blog/info/get').then(({data})=>{


    if(data.code === 200) {
      let blogInfo = {}
      blogInfo.articleNum = data.data.articleNum
      blogInfo.tagNum = data.data.tagNum
      for (let item of data.data.blogInfo) {
        blogInfo[item.oId] = item.optionValue
      }
      store.commit('SET_STORE_VALUE', {
        blogInfo: blogInfo
      })
      store.commit("SET_STORE_VALUE", {
        blogTitle: blogInfo.blogTitle,
        subTitle: blogInfo.blogSubtitle,
        sumArticleComments:data.data.comments,
        tongji: data.data.tongji && data.data.tongji.result,

      })
    }
  })
}
